package com.cly.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.web.multipart.MultipartFile;

import java.io.Serial;
import java.io.Serializable;

/**
 * 文件分片传输对象
 *
 * @author by 春风能解释
 * <p>
 * 2024/9/17
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@Schema(description = "文件分片传输对象")
public class FileChunkDto implements Serializable {

    /**
     * 序列化版本号
     */
    @Serial
    private static final long serialVersionUID = 8103666930199950364L;

    /**
     * 分片序号
     */
    @Schema(description = "分片序号")
    private Long chunkNumber;

    /**
     * 分片大小
     */
    @Schema(description = "分片大小")
    private Long chunkSize;

    /**
     * 当前分片大小
     */
    @Schema(description = "当前分片大小")
    private Long currentChunkSize;

    /**
     * 总大小
     */
    @Schema(description = "总大小")
    private Long totalSize;

    /**
     * 文件md5
     */
    @Schema(description = "文件md5")
    private String identifier;

    /**
     * 文件名
     */
    @Schema(description = "文件名")
    private String filename;

    /**
     * 总分片数
     */
    @Schema(description = "总分片数")
    private Long totalChunks;

    /**
     * 文件
     */
    @JSONField(serialize = false)
    @Schema(description = "文件")
    private MultipartFile file;
}
